import {
  CATE_ENABLE_OPTIONS,
  CategoryTypeLabels,
  WhetherLabels,
  CategoryEnableLabels,
} from '@/constants/basics';

export const FORM_ITEMS = [
  {
    prop: 'categoryNo',
    label: '品类编号',
    type: 'input',
  },
  {
    prop: 'categoryName',
    label: '品类名称',
    type: 'input'
  },
  {
    prop: 'state',
    label: '启用状态',
    type: 'select',
    clearable: true,
    options: CATE_ENABLE_OPTIONS
  },
]

export const TABLE_COLUMNS = [
  {
    title: '品类编号',
    key: 'categoryNo',
  },
  {
    title: '品类名称',
    key: 'categoryName',
  },
  {
    title: '品类类型',
    render: (h, { row }) => <span>{CategoryTypeLabels[row.categoryType]}</span>
  },
  {
    title: '父分类',
    key: 'parentUuidStr',
  },
  {
    title: '是否价格敏感',
    render: (h, { row }) => <span>{WhetherLabels[row.isPriceSensitive]}</span>
  },
  {
    title: '启用状态',
    render: (h, { row }) => <span>{CategoryEnableLabels[row.state]}</span>
  }
]
